import { Redirect } from 'umi';
import { message } from 'antd';
import { isLogin } from './useAuth';

export default (props) => {
  if (isLogin()) {
    return <div>{props.children}</div>;
  } else {
    message.error('请先登录');
    return <Redirect to="/login" />;
  }
};
